package errorcode

func msgInit() {
	errorMsg = make(map[uint]string)
	errorMsg[EC_GL_SUCCESS] = "成功"
	errorMsg[PM_LOGIN_PERMISSION_DENIDE] = "您需要先登录才能操作哟~"
	errorMsg[EC_GL_INVALID_ACCESS_TOKEN] = "无效的access_token，未登录"
	errorMsg[EC_GL_INVALID_APPKEY] = "未授权的appkey"
	errorMsg[EC_GL_INVALID_IP] = "请求者的IP被封禁"
	errorMsg[EC_GL_INVALID_URL_TIME] = "URL时间戳差距过大，拒绝服务"
	errorMsg[EC_GL_INVALID_URL_SIGN] = "URL签名非法"
	errorMsg[EC_GL_INVALID_SERVICE] = "同步服务非法"
	errorMsg[EC_GL_INVALID_SESSIONID] = "会话id错误"
	errorMsg[EC_GL_INVALID_HTTPS] = "必须是https请求"
	errorMsg[EC_GL_INVALID_URL_PARAMS] = "URL参数非法 "

	errorMsg[EC_GL_INVALID_JSON_BODY] = "无法解析的body json字符串"

	errorMsg[EC_GL_INTERNAL_ERROR] = "服务器内部错误"

	//业务错误码对应msg
	errorMsg[EC_GL_USER_HAS_NO_DATA] = "暂且没有数据"
	errorMsg[EC_ACCOUNT_USER_NOT_REGISTER] = "用户尚未在账号系统注册"
	errorMsg[EC_ACCOUNT_MOBILE_INVALID] = "无效的手机号码"
	errorMsg[EC_ACCOUNT_USER_REGISTER_BY_PASSPORT_FAIL] = "在账号系统注册失败"

	errorMsg[EC_QKLEAGUE_PERMISSION_DENY] = "尚未得到加盟商体系授权"
	errorMsg[EC_QKLEAGUE_USER_NOT_EXIST] = "用户不存在"

	errorMsg[EC_USER_INFO_USER_ID_MISSING] = "url参数uid不能为空"
	errorMsg[EC_USER_INFO_MODIFY_USER_ID_MISSING] = "body参数uid缺失"

	errorMsg[EC_STATIS_WASHROOM_HAS_NO_ORDER] = "洗衣房截止没有订单"
	errorMsg[EC_STATIS_USER_HAS_NO_BILL] = "用户暂且没有账单"
	errorMsg[EC_STATIS_PARAMS_INVALID] = "统计参数错误"

	errorMsg[EC_WASHER_ENABLE_PARAM_ERR] = "停启用洗衣机参数错误"
	errorMsg[EC_WASHER_WASHER_LOCATE_WASHER_ID_INVALID] = "定位洗衣机洗衣机id参数无效"
}

func Msg(errcode uint) string {
	if msg, ok := errorMsg[errcode]; ok {
		return msg
	}
	return ""
}
